package com.mycompany.myapp.service;

import com.mycompany.myapp.domain.Order;
import com.mycompany.myapp.service.dto.OrderDTO;
import com.mycompany.myapp.web.rest.utils.ResultObj;
import com.mycompany.myapp.web.rest.vm.OrderVM;
import org.springframework.data.domain.Page;

import java.time.ZonedDateTime;
import java.util.List;
import java.util.Optional;

/**
 * Service Interface for managing {@link com.mycompany.myapp.domain.Order}.
 */
public interface OrderService {

    /**
     * Save a order.
     *
     * @param orderDTO the entity to save.
     * @return the persisted entity.
     */
    OrderDTO save(OrderDTO orderDTO);

    /**
     * Get all the orders.
     *
     * @return the list of entities.
     */
    List<OrderDTO> findAll();


    /**
     * Get the "id" order.
     *
     * @param id the id of the entity.
     * @return the entity.
     */
    Optional<OrderDTO> findOne(Long id);

    /**
     * Delete the "id" order.
     *
     * @param id the id of the entity.
     */
    void delete(Long id);

    ResultObj createOrder(OrderVM orderVM);

    List<OrderDTO> findOrderByUserId(Long userId);

    List<OrderDTO> findAllUnfinishOrders(Long userId);

    ResultObj payOrder(Long id);

    List<OrderDTO> findAllFinishOrder(Long userId);

    ResultObj deleteOrderById(Long orderId);

    ResultObj findByParams(int pageNum, int pageSize, String query);

    ResultObj updateOrderInfo(OrderDTO orderDTO);

    ResultObj selectAllByToDay();

    ResultObj selectAllByWeek();

    ResultObj selectAllByAnyTime(String startTime, String endTime);
}
